function results = SVMWeka(cfg,data,timecoursevariant,SVMpass)

name         = [data.ROI,timecoursevariant];
classindex   = size(data.ERmatrix{1},1)+1;

featureNames = cell(1,size(data.ERmatrix{1},1)); featureNames{end+1}='Class'; counter=1;
for m=1:size(data.ERmatrix{1},1);
    featureNames{counter} = ['Voxel ' num2str(ceil(cfg.NoVox/size(data.ERmatrix{1},1)*m)) ' Feature ' num2str(mod(m-1,(cfg.CombineEvents(2))-cfg.CombineEvents(1)+1)+1)]; counter=counter+1;
end;
data.wekamatrix = [num2cell(SVMjoincell(data.ERmatrix, ones(1,cfg.NoLogs)))' num2cell(data.(timecoursevariant)(logical(cfg.actualuse.*repmat(ones(1,cfg.NoLogs),size(cfg.actualuse,1),1))))];
matlab2weka([cfg.subject num2str(cfg.SVMruns)], featureNames, data,classindex)
 
end